﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DAL;
using DTO;

namespace BUS
{
    public class SachBUS
    {
        SachDAO Sach_DAO = new SachDAO();
        public void khoitao_KN()
        {
            SqlConnection conn = new SqlConnection();
            conn = Sach_DAO.khoitaoKN();
        }
        public SqlConnection ChuoiKN_Load()
        {
            SqlConnection conn1 = Sach_DAO .khoitaoKN();
            return conn1;
        }
        public string Phatsinh_MaSach()
        {
            return Sach_DAO.Phatsinh_masach();
        }
        public void them_Sach(SachDTO sach_dto)
        {
            Sach_DAO.themsach(sach_dto);
        }
        public void xoa_sach(SachDTO sach_dto)
        {
            Sach_DAO.xoaSach(sach_dto);
        }
        public void Sus_Sach(SachDTO sach_dto)
        {
            Sach_DAO.Sua_Sach(sach_dto);
        }
        public DataSet Hien_Sach()
        {
            return Sach_DAO.HienThi_Sach ();
        }
        public DataSet TimKiem_SachTheoMa(string masach)
        {
            return Sach_DAO.TimKiemTheoMaSach(masach);
        }
        public DataSet TimTheoTenSach(string tensach)
        {
            return Sach_DAO.TimKiemTheoTenSach(tensach);
        
        }
        public DataSet TimTheo_TacGia(string tacgia)
        {
            return Sach_DAO.TimKiemTheoTacGia(tacgia);
        }
        public DataSet TimTheo_GiaTien(decimal tu, decimal den)
        {
            return Sach_DAO.TimTheoGT(tu, den);
        }
        public DataSet TimTheo_NamXB(int tunam, int dennam)
        {
            return Sach_DAO.TimTheo_NanXB(tunam, dennam);
        }
        public DataSet TimTheo_NhaXB(string nhaXB)
        {
            return Sach_DAO.TimKiemTheoNhaXB(nhaXB);
        }
        //public DataSet TimKiem_TheoMaNV(string tacgia)
        //{
        //    return Sach_DAO.t
        //}
        //public DataSet TimKiem_theotenNV(string tennv)
        //{
        //    return NV_DAO.TimKiemTheoTen(tennv);
        //}
        //public DataSet TimKiem_TheoNamSinh(int tu, int den)
        //{
        //    return NV_DAO.TimtheoNamSinh(tu, den);
        //}
    }
}
